Coming Soon
-
STASHKU_FETCH_MODEL_HEADER
Determines whether the fetch request to the HTTP endpoint will forward the model header whenSTASHKU_MODEL_HEADER
is enabled. By default this is disabled and the headermodel
property will not be sent. Setting this flag totrue
will forward themodel
header of the StashKu request.JavaScript Example
new StashKu({ fetch: { model: { header: false } } } })
Shell/Environment Example
export STASHKU_FETCH_MODEL_HEADER=false
-
STASHKU_FETCH_MODEL_PATH_PROPERTY
Instructs StashKu which property from the$stashku
object on a model type to populate the resource (to
orfrom
) on a request. Can be"name"
,"slug"
,"plural.name"
,"plural.slug"
, or"resource"
(default).This requires that the
STASHKU_MODEL_HEADER
setting istrue
, or that you manually pass the appropriatemodel
header object in requests to the fetch engine. If the appropriate property is not found in the header, the request's resource (to
/from
) is used instead.JavaScript Example
new StashKu({ fetch: { model: { pathProperty: 'plural.slug' } } } })
Shell/Environment Example
export STASHKU_FETCH_MODEL_PATH_PROPERTY=plural.slug